package com.huatai.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 分片上传-分片任务记录
 *
 * @author xuzy
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("tb_upload_task")
public class UploadTaskEntity {

    /**
     * mybatis plus 自动生成
     */
    private Long id;

	@TableField("upload_id")
	@ApiModelProperty("分片上传的 uploadId")
    private String uploadId;

	@TableField("file_identifier")
	@ApiModelProperty("文件唯一标识")
    private String fileIdentifier;

	@TableField("file_name")
	@ApiModelProperty("文件名")
    private String fileName;

	@TableField("file_type")
	@ApiModelProperty("文件类型")
    private String fileType;

	@TableField("bucket_name")
	@ApiModelProperty("所属桶名")
    private String bucketName;

	@TableField("object_key")
	@ApiModelProperty("文件的key")
    private String objectKey;

	@TableField("save_full_path")
	@ApiModelProperty("保存的全路径名")
    private String saveFullPath;

	@TableField("total_size")
	@ApiModelProperty("文件大小")
    private Long totalSize;

	@TableField("chunk_size")
	@ApiModelProperty("每个分片大小")
    private Long chunkSize;

	@TableField("chunk_number")
	@ApiModelProperty("分片数量")
    private Integer chunkNumber;

	@ApiModelProperty("是否上传完成")
    @TableField(value = "is_completed")
    private boolean completed;

	@ApiModelProperty("是否删除")
    @TableField(value = "is_deleted")
    @TableLogic
    private boolean deleted;

	@ApiModelProperty("创建时间")
	@TableField(value = "create_time")
	private LocalDateTime createTime;

	@TableField("file_sufix")
	@ApiModelProperty("文件后缀")
	private String fileSufix;
}
